#ifndef BOARD_H
#define BOARD_H

#include "Interface.h"

static const unsigned int BOARD_SIZE = 8;
static const unsigned int ROWS       = 3;

class Board : public IBoard
{
public :

    Board( void );
    ~Board( void );

public : // IBoard implementation    
    
    void Release( void );

    void Initialize(
        Piece top,
        Piece bottom
    );

    bool Move(
        const IRoute * route
    );

    inline bool IsValidPosition(
        const Position * position
    ) const;

    bool GetPiece(
        const Position * position,
              Piece &    piece
    ) const;

    inline unsigned int GetSize( void ) const;

private :

    void Draw( void ) const;

    bool SetPiece(
        const Position * position,
              Piece      piece
    );

    bool IsValidMove(
        const Position * from,
        const Position * to
    );

    Piece m_board[ BOARD_SIZE ][ BOARD_SIZE ];

    static void Release( Board * board );
};

#endif // BOARD_H